package com.dyc.maitaole.controller;

import com.dyc.maitaole.entity.BasicInfo;
import com.dyc.maitaole.service.BasicInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;

@Controller
@RequestMapping("/price")
public class PriceController {
    @Autowired
    private BasicInfoService basicInfoService;

    @RequestMapping("/pricelist")
    public ModelAndView caculatePrice(Integer goodId,int[] infoDetailIds){
        List<BasicInfo> basicInfos = basicInfoService.findAll(goodId);
        ModelAndView modelAndView = new ModelAndView("/price.jsp");
        modelAndView.addObject("basicInfos",basicInfos);
        modelAndView.addObject("infoDetailIds",infoDetailIds);
        return modelAndView;
        
    }

}
